package com.yjt.fresh.api;

import android.app.Activity;

import com.wzgiceman.rxretrofitlibrary.retrofit_rx.Api.BaseApi;
import com.wzgiceman.rxretrofitlibrary.retrofit_rx.listener.HttpOnNextListener;
import com.yjt.fresh.httpservice.HttpPostService;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * 首页课程菜单
 * Created by WZG on 2016/7/16.
 */
public class IndexLivePostApi extends BaseApi {
//    接口需要传入的参数 可自定义不同类型
    private int type;
    /*任何你先要传递的参数*/
//    String xxxxx;
//    String xxxxx;
//    String xxxxx;
//    String xxxxx;


    /**
     * 默认初始化需要给定回调和rx周期类
     * 可以额外设置请求设置加载框显示，回调等（可扩展）
     * @param listener
     * @param rxAppCompatActivity
     */
    public IndexLivePostApi(HttpOnNextListener listener, Activity rxAppCompatActivity, boolean showProgress, boolean cache, boolean cancel) {
        super(listener,rxAppCompatActivity,showProgress,cache,cancel);
//        setShowProgress(true);
//        setCancel(true);
//        setCache(true);
//        setMethod("AppFiftyToneGraph/videoLink");
//        setCookieNetWorkTime(60);
//        setCookieNoNetWorkTime(24*60*60);
    }




    public void setParam(int type) {
        this.type = type;
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostService service = retrofit.create(HttpPostService.class);
        return service.getIndexLiveList();
    }
}
